package com.base.app_core.util;

import android.content.Context;
import android.content.SharedPreferences;

import com.base.app_core.App;


/**
 * Created by xiangheng.song on 2017/3/7.
 */

public class Preferences {

    private static final String DEFAULT_PREF_KEY = "default_pref";

    public static SharedPreferences getDefault() {
        return App.getContext().getSharedPreferences(DEFAULT_PREF_KEY, Context.MODE_PRIVATE);
    }

    public static void putString(final String key, final String value) {
        getDefault().edit().putString(key, value).apply();
    }

    public static void putLong(final String key, final long value) {
        getDefault().edit().putLong(key, value).apply();
    }

    public static void putBoolean(final String key, final boolean value) {
        getDefault().edit().putBoolean(key, value).apply();
    }
}
